
package com.gs.netty.core.interceptor;


public interface HandlerInterceptor<Request,Response> {

	/**
	 * 前置处理
	 * @param request
	 * @param response
	 * @param handler
	 * @return
	 * @throws Exception
	 */
	default boolean preHandle(Request request, Response response, Object handler)
			throws Exception {

		return true;
	}

	/**
	 * 后置处理
	 * @param request
	 * @param response
	 * @param handler
	 * @param o
	 * @throws Exception
	 */
	default void postHandle(Request request, Response response, Object handler ,Object o) throws Exception {
	}

	/**
	 * 最后完成处理
	 * @param request
	 * @param response
	 * @param handler
	 * @param ex
	 * @throws Exception
	 */
	default void afterCompletion(Request request, Response response, Object handler,
			 Exception ex) throws Exception {
	}

}
